<?php

namespace app\admin\controller;

class Config extends Admin {

	public function index() {
		$mCfonfig = D('api/Configure');

		$res = $mCfonfig->find(1);
		return $this->fetch('index', ['res' => $res]);
	}

	public function update() {
		if (IS_POST) {
			//自动验证
			$mCfonfig = D('api/Configure');
			$res = $mCfonfig->update();
			if (!intval($res)) {
				return $this->error($res);
			} else {
				return $this->success('修改成功！');
			}
		}
	}
}
